package com.zw.rpc.client;

import com.zw.rpc.Peer;
import com.zw.rpc.client.impl.RandomTransportSelector;
import com.zw.rpc.codec.Decoder;
import com.zw.rpc.codec.Encoder;
import com.zw.rpc.codec.impl.JsonDecoder;
import com.zw.rpc.codec.impl.JsonEncoder;
import com.zw.rpc.transport.TransportClient;
import com.zw.rpc.transport.impl.HttpTransportClient;
import lombok.Data;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * RpcClient 配置类
 * 
 * @author zw
 */
@Data
public class RpcClientConfig {

    private Class<? extends TransportClient> transportClient = HttpTransportClient.class;

    private Class<? extends Encoder> encoder = JsonEncoder.class;

    private Class<? extends Decoder> decoder = JsonDecoder.class;

    private Class<? extends TransportSelector> selector = RandomTransportSelector.class;

    private int connectCount = 1;

    private List<Peer> peers = Collections.singletonList(new Peer().setHost("127.0.0.1").setPort(3000));

}
